<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>表单下</title>
  </head>
  <body>
    <div class="box">
      <div>
        <pre>
              select的模板数据中默认是数组也可以，但是没有默认选中，设置selected也没有用
          </pre
        >
        <select name="" id="" v-model="selects" multiple>
          <option value="0" selected>0</option>
          <option value="1">1</option>
          <option value="2">2</option>
          <option value="3">3</option>
        </select>
        <button @click="get">提交</button>
      </div>
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
      new Vue({
        el: '.box',
        data: {
          selects: ['1'],
        },
        methods: {
          get() {
            console.log(this.selects)
          },
        },
      })
    </script>
  </body>
</html>
